# -*- coding: utf-8 -*-
from django.contrib.auth import admin
#from django.contrib.admin import site

from django.utils.translation import ugettext, ugettext_lazy as _
from main.models import Series, Episode, Comment

class UserAdmin(admin.UserAdmin):
    fieldsets = (
        (None, {'fields': ('username', 'password')}),
        (_('Personal info'), {'fields': ('first_name', 'last_name', 'email')}),
        (_('Permissions'), {'fields': ('is_staff', 'is_active', 'is_superuser', 'user_permissions')}),
        (_('Important dates'), {'fields': ('last_login', 'date_joined')}),
        (_('Groups'), {'fields': ('groups',)}),
        (_('Profile'), {'fields': ('uid', 'origin', 'nickname', 'tinyurl', 'headurl', 'watched_series_ids', 'loc', 'sex', 'zidou', 'info_updated')}),
    )
    list_display = ('username', 'uid', 'origin', 'nickname', 'loc', 'sex', 'zidou', 'info_updated', 'watched_series_ids_display')

    
#site.unregister(User)
#site.register(User, UserAdmin)

class SeriesAdmin(admin.admin.ModelAdmin):
    list_display = ('name', 'xiaoli_category_id', 'xiaoli_series_id', 'views_count', )

#site.register(Series, SeriesAdmin)

class EpisodeAdmin(admin.admin.ModelAdmin):
    list_display = ('series', 'xiaoli_category_id', 'xiaoli_series_id', 'series_name', 'xiaoli_slug', 'name', 'watched_xn_users_display', 'watched_51_users_display', 'views_count')

#site.register(Episode, EpisodeAdmin)

class CommentAdmin(admin.admin.ModelAdmin):
    list_display = ('user', 'origin', 'content', 'created_cn', 'series', 'episode')

#site.register(Comment, CommentAdmin)